package com.help10000.rms.ui.utils

import android.content.Context
import android.content.Intent
import com.help10000.rms.ui.activitys.ResultActivity

class PageUtils {
    companion object {
        fun <T> jumpToActivity(context: Context?, cls: Class<T>) {
            val intent = Intent()
            intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
            context?.apply {
                intent.setClass(this, cls)
                startActivity(intent)
            }
        }



        fun <T> jumpToResult(context: Context?, cls: Class<T>, result: Boolean, content: String?) {
            val intent = Intent()
            intent.flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
            context?.apply {
                intent.setClass(this, ResultActivity::class.java)
                intent.putExtra("cls", cls)
                intent.putExtra("result", result)
                intent.putExtra("content", content)
                startActivity(intent)
            }
        }


    }
}